<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link href="cpip.css" rel="stylesheet" type="text/css" />
    <title>File: /Users/paulross/dev/Python-3.6.2/Include/ceval.h</title>
  </head>
  <body>
    <h1>File: /Users/paulross/dev/Python-3.6.2/Include/ceval.h</h1>
    <p>Green shading in the line number column
means the source is part of the translation unit, red means it is conditionally excluded.
Highlighted line numbers link to the translation unit page. Highlighted macros link to
the macro page.</p>
    <pre><a name="1" /><span class="True">       1:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="macros_noref.html#_UHlfQ0VWQUxfSF8w"><span class="b">Py_CEVAL_H</span></a>
<a name="2" /><span class="True">       2:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfQ0VWQUxfSF8w"><span class="b">Py_CEVAL_H</span></a>
<a name="3" /><span class="False">       3:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">__cplusplus</span>
<a name="4" /><span class="False">       4:</span> <span class="m">extern</span> <span class="e">&quot;C&quot;</span> <span class="f">{</span>
<a name="5" /><span class="True">       5:</span> <span class="f">#</span><span class="n">endif</span>
<a name="6" /><span class="True">       6:</span> 
<a name="7" /><span class="True">       7:</span> 
<a name="8" /><span class="True">       8:</span> <span class="k">/* Interface to random parts in ceval.c */</span>
<a name="9" /><span class="True">       9:</span> 
<a name="10" /><span class="True">      10:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyEval_CallObjectWithKeywords</span><span class="f">(</span>
<a name="11" /><span class="True">      11:</span>     <span class="b">PyObject</span> <span class="f">*</span><span class="b">func</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">args</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="b">kwargs</span><span class="f">)</span><span class="f">;</span>
<a name="12" /><span class="True">      12:</span> 
<a name="13" /><span class="True">      13:</span> <span class="k">/* Inline this */</span>
<a name="14" /><span class="True">      14:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlFdmFsX0NhbGxPYmplY3RfMA__"><span class="b">PyEval_CallObject</span></a><span class="f">(</span><span class="b">func</span><span class="f">,</span><span class="b">arg</span><span class="f">)</span> \
<a name="15" /><span class="True">      15:</span>     <span class="b">PyEval_CallObjectWithKeywords</span><span class="f">(</span><span class="b">func</span><span class="f">,</span> <span class="b">arg</span><span class="f">,</span> <span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span><a href="macros_ref.html#_TlVMTF8w"><span class="b">NULL</span></a><span class="f">)</span>
<a name="16" /><span class="True">      16:</span> 
<a name="17" /><span class="True">      17:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyEval_CallFunction</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">obj</span><span class="f">,</span>
<a name="18" /><span class="True">      18:</span>                                            <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">format</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="19" /><span class="True">      19:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyEval_CallMethod</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="b">obj</span><span class="f">,</span>
<a name="20" /><span class="True">      20:</span>                                          <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">methodname</span><span class="f">,</span>
<a name="21" /><span class="True">      21:</span>                                          <span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">format</span><span class="f">,</span> <span class="f">...</span><span class="f">)</span><span class="f">;</span>
<a name="22" /><span class="True">      22:</span> 
<a name="23" /><span class="True">      23:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="24" /><span class="True">      24:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">PyEval_SetProfile</span><span class="f">(</span><span class="b">Py_tracefunc</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="25" /><span class="True">      25:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">PyEval_SetTrace</span><span class="f">(</span><span class="b">Py_tracefunc</span><span class="f">,</span> <span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="26" /><span class="True">      26:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">_PyEval_SetCoroutineWrapper</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="27" /><span class="True">      27:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">_PyEval_GetCoroutineWrapper</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="28" /><span class="True">      28:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">_PyEval_SetAsyncGenFirstiter</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="29" /><span class="True">      29:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">_PyEval_GetAsyncGenFirstiter</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="30" /><span class="True">      30:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">_PyEval_SetAsyncGenFinalizer</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="31" /><span class="True">      31:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">_PyEval_GetAsyncGenFinalizer</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="32" /><span class="True">      32:</span> <span class="f">#</span><span class="n">endif</span>
<a name="33" /><span class="True">      33:</span> 
<a name="34" /><span class="True">      34:</span> <span class="m">struct</span> <span class="b">_frame</span><span class="f">;</span> <span class="k">/* Avoid including frameobject.h */</span>
<a name="35" /><span class="True">      35:</span> 
<a name="36" /><span class="True">      36:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyEval_GetBuiltins</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="37" /><span class="True">      37:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyEval_GetGlobals</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="38" /><span class="True">      38:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyEval_GetLocals</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="39" /><span class="True">      39:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">struct</span> <span class="b">_frame</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyEval_GetFrame</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="40" /><span class="True">      40:</span> 
<a name="41" /><span class="True">      41:</span> <span class="k">/* Look at the current frame&apos;s (if any) code&apos;s co_flags, and turn on</span>
<a name="42" /><span class="True">      42:</span> <span class="k">   the corresponding compiler flags in cf-&gt;cf_flags.  Return 1 if any</span>
<a name="43" /><span class="True">      43:</span> <span class="k">   flag was set, else return 0. */</span>
<a name="44" /><span class="True">      44:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="45" /><span class="True">      45:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">PyEval_MergeCompilerFlags</span><span class="f">(</span><span class="b">PyCompilerFlags</span> <span class="f">*</span><span class="b">cf</span><span class="f">)</span><span class="f">;</span>
<a name="46" /><span class="True">      46:</span> <span class="f">#</span><span class="n">endif</span>
<a name="47" /><span class="True">      47:</span> 
<a name="48" /><span class="True">      48:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">Py_AddPendingCall</span><span class="f">(</span><span class="m">int</span> <span class="f">(</span><span class="f">*</span><span class="b">func</span><span class="f">)</span><span class="f">(</span><span class="m">void</span> <span class="f">*</span><span class="f">)</span><span class="f">,</span> <span class="m">void</span> <span class="f">*</span><span class="b">arg</span><span class="f">)</span><span class="f">;</span>
<a name="49" /><span class="True">      49:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">Py_MakePendingCalls</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="50" /><span class="True">      50:</span> 
<a name="51" /><span class="True">      51:</span> <span class="k">/* Protection against deeply nested recursive calls</span>
<a name="52" /><span class="True">      52:</span> <span class="k"></span>
<a name="53" /><span class="True">      53:</span> <span class="k">   In Python 3.0, this protection has two levels:</span>
<a name="54" /><span class="True">      54:</span> <span class="k">   * normal anti-recursion protection is triggered when the recursion level</span>
<a name="55" /><span class="True">      55:</span> <span class="k">     exceeds the current recursion limit. It raises a RecursionError, and sets</span>
<a name="56" /><span class="True">      56:</span> <span class="k">     the &quot;overflowed&quot; flag in the thread state structure. This flag</span>
<a name="57" /><span class="True">      57:</span> <span class="k">     temporarily *disables* the normal protection; this allows cleanup code</span>
<a name="58" /><span class="True">      58:</span> <span class="k">     to potentially outgrow the recursion limit while processing the</span>
<a name="59" /><span class="True">      59:</span> <span class="k">     RecursionError.</span>
<a name="60" /><span class="True">      60:</span> <span class="k">   * &quot;last chance&quot; anti-recursion protection is triggered when the recursion</span>
<a name="61" /><span class="True">      61:</span> <span class="k">     level exceeds &quot;current recursion limit + 50&quot;. By construction, this</span>
<a name="62" /><span class="True">      62:</span> <span class="k">     protection can only be triggered when the &quot;overflowed&quot; flag is set. It</span>
<a name="63" /><span class="True">      63:</span> <span class="k">     means the cleanup code has itself gone into an infinite loop, or the</span>
<a name="64" /><span class="True">      64:</span> <span class="k">     RecursionError has been mistakingly ignored. When this protection is</span>
<a name="65" /><span class="True">      65:</span> <span class="k">     triggered, the interpreter aborts with a Fatal Error.</span>
<a name="66" /><span class="True">      66:</span> <span class="k"></span>
<a name="67" /><span class="True">      67:</span> <span class="k">   In addition, the &quot;overflowed&quot; flag is automatically reset when the</span>
<a name="68" /><span class="True">      68:</span> <span class="k">   recursion level drops below &quot;current recursion limit - 50&quot;. This heuristic</span>
<a name="69" /><span class="True">      69:</span> <span class="k">   is meant to ensure that the normal anti-recursion protection doesn&apos;t get</span>
<a name="70" /><span class="True">      70:</span> <span class="k">   disabled too long.</span>
<a name="71" /><span class="True">      71:</span> <span class="k"></span>
<a name="72" /><span class="True">      72:</span> <span class="k">   Please note: this scheme has its own limitations. See:</span>
<a name="73" /><span class="True">      73:</span> <span class="k">   http://mail.python.org/pipermail/python-dev/2008-August/082106.html</span>
<a name="74" /><span class="True">      74:</span> <span class="k">   for some observations.</span>
<a name="75" /><span class="True">      75:</span> <span class="k">*/</span>
<a name="76" /><span class="True">      76:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">Py_SetRecursionLimit</span><span class="f">(</span><span class="m">int</span><span class="f">)</span><span class="f">;</span>
<a name="77" /><span class="True">      77:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">Py_GetRecursionLimit</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="78" /><span class="True">      78:</span> 
<a name="79" /><span class="True">      79:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfRW50ZXJSZWN1cnNpdmVDYWxsXzA_"><span class="b">Py_EnterRecursiveCall</span></a><span class="f">(</span><span class="b">where</span><span class="f">)</span>  \
<a name="80" /><span class="True">      80:</span>             <span class="f">(</span><a href="macros_noref.html#_X1B5X01ha2VSZWNDaGVja18w"><span class="b">_Py_MakeRecCheck</span></a><span class="f">(</span><a href="macros_ref.html#_UHlUaHJlYWRTdGF0ZV9HRVRfMA__"><span class="b">PyThreadState_GET</span></a><span class="f">(</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">recursion_depth</span><span class="f">)</span> <span class="f">&amp;&amp;</span>  \
<a name="81" /><span class="True">      81:</span>              <span class="b">_Py_CheckRecursiveCall</span><span class="f">(</span><span class="b">where</span><span class="f">)</span><span class="f">)</span>
<a name="82" /><span class="True">      82:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfTGVhdmVSZWN1cnNpdmVDYWxsXzA_"><span class="b">Py_LeaveRecursiveCall</span></a><span class="f">(</span><span class="f">)</span>                         \
<a name="83" /><span class="True">      83:</span>     <span class="m">do</span><span class="f">{</span> <span class="m">if</span><span class="f">(</span><a href="macros_noref.html#_X1B5X01ha2VFbmRSZWNDaGVja18w"><span class="b">_Py_MakeEndRecCheck</span></a><span class="f">(</span><a href="macros_ref.html#_UHlUaHJlYWRTdGF0ZV9HRVRfMA__"><span class="b">PyThreadState_GET</span></a><span class="f">(</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">recursion_depth</span><span class="f">)</span><span class="f">)</span>  \
<a name="84" /><span class="True">      84:</span>       <a href="macros_ref.html#_UHlUaHJlYWRTdGF0ZV9HRVRfMA__"><span class="b">PyThreadState_GET</span></a><span class="f">(</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">overflowed</span> <span class="f">=</span> <span class="c">0</span><span class="f">;</span>  \
<a name="85" /><span class="True">      85:</span>     <span class="f">}</span> <span class="m">while</span><span class="f">(</span><span class="c">0</span><span class="f">)</span>
<a name="86" /><span class="True">      86:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">_Py_CheckRecursiveCall</span><span class="f">(</span><span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="b">where</span><span class="f">)</span><span class="f">;</span>
<a name="87" /><span class="True">      87:</span> <a href="macros_ref.html#_UHlBUElfREFUQV8w"><span class="b">PyAPI_DATA</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">_Py_CheckRecursionLimit</span><span class="f">;</span>
<a name="88" /><span class="True">      88:</span> 
<a name="89" /><span class="False">      89:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">USE_STACKCHECK</span>
<a name="90" /><span class="False">      90:</span> <span class="k">/* With USE_STACKCHECK, we artificially decrement the recursion limit in order</span>
<a name="91" /><span class="False">      91:</span> <span class="k">   to trigger regular stack checks in _Py_CheckRecursiveCall(), except if</span>
<a name="92" /><span class="False">      92:</span> <span class="k">   the &quot;overflowed&quot; flag is set, in which case we need the true value</span>
<a name="93" /><span class="False">      93:</span> <span class="k">   of _Py_CheckRecursionLimit for _Py_MakeEndRecCheck() to function properly.</span>
<a name="94" /><span class="False">      94:</span> <span class="k">*/</span>
<a name="95" /><span class="False">      95:</span> <span class="f">#</span>  <span class="n">define</span> <a href="macros_noref.html#_X1B5X01ha2VSZWNDaGVja18w"><span class="b">_Py_MakeRecCheck</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span>  \
<a name="96" /><span class="False">      96:</span>     <span class="f">(</span><span class="f">++</span><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="f">&gt;</span> <span class="f">(</span><span class="b">_Py_CheckRecursionLimit</span> <span class="f">+=</span> <a href="macros_ref.html#_UHlUaHJlYWRTdGF0ZV9HRVRfMA__"><span class="b">PyThreadState_GET</span></a><span class="f">(</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">overflowed</span> <span class="f">-</span> <span class="c">1</span><span class="f">)</span><span class="f">)</span>
<a name="97" /><span class="True">      97:</span> <span class="f">#</span><span class="n">else</span>
<a name="98" /><span class="True">      98:</span> <span class="f">#</span>  <span class="n">define</span> <a href="macros_noref.html#_X1B5X01ha2VSZWNDaGVja18w"><span class="b">_Py_MakeRecCheck</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span>  <span class="f">(</span><span class="f">++</span><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="f">&gt;</span> <span class="b">_Py_CheckRecursionLimit</span><span class="f">)</span>
<a name="99" /><span class="True">      99:</span> <span class="f">#</span><span class="n">endif</span>
<a name="100" /><span class="True">     100:</span> 
<a name="101" /><span class="True">     101:</span> <span class="k">/* Compute the &quot;lower-water mark&quot; for a recursion limit. When</span>
<a name="102" /><span class="True">     102:</span> <span class="k"> * Py_LeaveRecursiveCall() is called with a recursion depth below this mark,</span>
<a name="103" /><span class="True">     103:</span> <span class="k"> * the overflowed flag is reset to 0. */</span>
<a name="104" /><span class="True">     104:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X1JlY3Vyc2lvbkxpbWl0TG93ZXJXYXRlck1hcmtfMA__"><span class="b">_Py_RecursionLimitLowerWaterMark</span></a><span class="f">(</span><span class="b">limit</span><span class="f">)</span> \
<a name="105" /><span class="True">     105:</span>     <span class="f">(</span><span class="f">(</span><span class="f">(</span><span class="b">limit</span><span class="f">)</span> <span class="f">&gt;</span> <span class="c">200</span><span class="f">)</span> \
<a name="106" /><span class="True">     106:</span>         <span class="f">?</span> <span class="f">(</span><span class="f">(</span><span class="b">limit</span><span class="f">)</span> <span class="f">-</span> <span class="c">50</span><span class="f">)</span> \
<a name="107" /><span class="True">     107:</span>         <span class="f">:</span> <span class="f">(</span><span class="c">3</span> <span class="f">*</span> <span class="f">(</span><span class="f">(</span><span class="b">limit</span><span class="f">)</span> <span class="f">&gt;&gt;</span> <span class="c">2</span><span class="f">)</span><span class="f">)</span><span class="f">)</span>
<a name="108" /><span class="True">     108:</span> 
<a name="109" /><span class="True">     109:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_X1B5X01ha2VFbmRSZWNDaGVja18w"><span class="b">_Py_MakeEndRecCheck</span></a><span class="f">(</span><span class="b">x</span><span class="f">)</span> \
<a name="110" /><span class="True">     110:</span>     <span class="f">(</span><span class="f">--</span><span class="f">(</span><span class="b">x</span><span class="f">)</span> <span class="f">&lt;</span> <a href="macros_noref.html#_X1B5X1JlY3Vyc2lvbkxpbWl0TG93ZXJXYXRlck1hcmtfMA__"><span class="b">_Py_RecursionLimitLowerWaterMark</span></a><span class="f">(</span><span class="b">_Py_CheckRecursionLimit</span><span class="f">)</span><span class="f">)</span>
<a name="111" /><span class="True">     111:</span> 
<a name="112" /><span class="True">     112:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfQUxMT1dfUkVDVVJTSU9OXzA_"><span class="b">Py_ALLOW_RECURSION</span></a> \
<a name="113" /><span class="True">     113:</span>   <span class="m">do</span> <span class="f">{</span> <span class="m">unsigned</span> <span class="m">char</span> <span class="b">_old</span> <span class="f">=</span> <a href="macros_ref.html#_UHlUaHJlYWRTdGF0ZV9HRVRfMA__"><span class="b">PyThreadState_GET</span></a><span class="f">(</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">recursion_critical</span><span class="f">;\
</span>    <a href="macros_ref.html#_UHlUaHJlYWRTdGF0ZV9HRVRfMA__"><span class="b">PyThreadState_GET</span></a><span class="f">(</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">recursion_critical</span> <span class="f">=</span> <span class="c">1</span><span class="f">;</span>
<a name="115" /><span class="True">     115:</span> 
<a name="116" /><span class="True">     116:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfRU5EX0FMTE9XX1JFQ1VSU0lPTl8w"><span class="b">Py_END_ALLOW_RECURSION</span></a> \
<a name="117" /><span class="True">     117:</span>     <a href="macros_ref.html#_UHlUaHJlYWRTdGF0ZV9HRVRfMA__"><span class="b">PyThreadState_GET</span></a><span class="f">(</span><span class="f">)</span><span class="f">-&gt;</span><span class="b">recursion_critical</span> <span class="f">=</span> <span class="b">_old</span><span class="f">;</span> \
<a name="118" /><span class="True">     118:</span>   <span class="f">}</span> <span class="m">while</span><span class="f">(</span><span class="c">0</span><span class="f">)</span><span class="f">;</span>
<a name="119" /><span class="True">     119:</span> 
<a name="120" /><span class="True">     120:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyEval_GetFuncName</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="121" /><span class="True">     121:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">const</span> <span class="m">char</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyEval_GetFuncDesc</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="122" /><span class="True">     122:</span> 
<a name="123" /><span class="True">     123:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyEval_GetCallStats</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="124" /><span class="True">     124:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyEval_EvalFrame</span><span class="f">(</span><span class="m">struct</span> <span class="b">_frame</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="125" /><span class="True">     125:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyEval_EvalFrameEx</span><span class="f">(</span><span class="m">struct</span> <span class="b">_frame</span> <span class="f">*</span><span class="b">f</span><span class="f">,</span> <span class="m">int</span> <span class="b">exc</span><span class="f">)</span><span class="f">;</span>
<a name="126" /><span class="True">     126:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="127" /><span class="True">     127:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">)</span> <span class="b">_PyEval_EvalFrameDefault</span><span class="f">(</span><span class="m">struct</span> <span class="b">_frame</span> <span class="f">*</span><span class="b">f</span><span class="f">,</span> <span class="m">int</span> <span class="b">exc</span><span class="f">)</span><span class="f">;</span>
<a name="128" /><span class="True">     128:</span> <span class="f">#</span><span class="n">endif</span>
<a name="129" /><span class="True">     129:</span> 
<a name="130" /><span class="True">     130:</span> <span class="k">/* Interface for threads.</span>
<a name="131" /><span class="True">     131:</span> <span class="k"></span>
<a name="132" /><span class="True">     132:</span> <span class="k">   A module that plans to do a blocking system call (or something else</span>
<a name="133" /><span class="True">     133:</span> <span class="k">   that lasts a long time and doesn&apos;t touch Python data) can allow other</span>
<a name="134" /><span class="True">     134:</span> <span class="k">   threads to run as follows:</span>
<a name="135" /><span class="True">     135:</span> <span class="k"></span>
<a name="136" /><span class="True">     136:</span> <span class="k">    ...preparations here...</span>
<a name="137" /><span class="True">     137:</span> <span class="k">    Py_BEGIN_ALLOW_THREADS</span>
<a name="138" /><span class="True">     138:</span> <span class="k">    ...blocking system call here...</span>
<a name="139" /><span class="True">     139:</span> <span class="k">    Py_END_ALLOW_THREADS</span>
<a name="140" /><span class="True">     140:</span> <span class="k">    ...interpret result here...</span>
<a name="141" /><span class="True">     141:</span> <span class="k"></span>
<a name="142" /><span class="True">     142:</span> <span class="k">   The Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS pair expands to a</span>
<a name="143" /><span class="True">     143:</span> <span class="k">   {}-surrounded block.</span>
<a name="144" /><span class="True">     144:</span> <span class="k">   To leave the block in the middle (e.g., with return), you must insert</span>
<a name="145" /><span class="True">     145:</span> <span class="k">   a line containing Py_BLOCK_THREADS before the return, e.g.</span>
<a name="146" /><span class="True">     146:</span> <span class="k"></span>
<a name="147" /><span class="True">     147:</span> <span class="k">    if (...premature_exit...) {</span>
<a name="148" /><span class="True">     148:</span> <span class="k">        Py_BLOCK_THREADS</span>
<a name="149" /><span class="True">     149:</span> <span class="k">        PyErr_SetFromErrno(PyExc_IOError);</span>
<a name="150" /><span class="True">     150:</span> <span class="k">        return NULL;</span>
<a name="151" /><span class="True">     151:</span> <span class="k">    }</span>
<a name="152" /><span class="True">     152:</span> <span class="k"></span>
<a name="153" /><span class="True">     153:</span> <span class="k">   An alternative is:</span>
<a name="154" /><span class="True">     154:</span> <span class="k"></span>
<a name="155" /><span class="True">     155:</span> <span class="k">    Py_BLOCK_THREADS</span>
<a name="156" /><span class="True">     156:</span> <span class="k">    if (...premature_exit...) {</span>
<a name="157" /><span class="True">     157:</span> <span class="k">        PyErr_SetFromErrno(PyExc_IOError);</span>
<a name="158" /><span class="True">     158:</span> <span class="k">        return NULL;</span>
<a name="159" /><span class="True">     159:</span> <span class="k">    }</span>
<a name="160" /><span class="True">     160:</span> <span class="k">    Py_UNBLOCK_THREADS</span>
<a name="161" /><span class="True">     161:</span> <span class="k"></span>
<a name="162" /><span class="True">     162:</span> <span class="k">   For convenience, that the value of &apos;errno&apos; is restored across</span>
<a name="163" /><span class="True">     163:</span> <span class="k">   Py_END_ALLOW_THREADS and Py_BLOCK_THREADS.</span>
<a name="164" /><span class="True">     164:</span> <span class="k"></span>
<a name="165" /><span class="True">     165:</span> <span class="k">   WARNING: NEVER NEST CALLS TO Py_BEGIN_ALLOW_THREADS AND</span>
<a name="166" /><span class="True">     166:</span> <span class="k">   Py_END_ALLOW_THREADS!!!</span>
<a name="167" /><span class="True">     167:</span> <span class="k"></span>
<a name="168" /><span class="True">     168:</span> <span class="k">   The function PyEval_InitThreads() should be called only from</span>
<a name="169" /><span class="True">     169:</span> <span class="k">   init_thread() in &quot;_threadmodule.c&quot;.</span>
<a name="170" /><span class="True">     170:</span> <span class="k"></span>
<a name="171" /><span class="True">     171:</span> <span class="k">   Note that not yet all candidates have been converted to use this</span>
<a name="172" /><span class="True">     172:</span> <span class="k">   mechanism!</span>
<a name="173" /><span class="True">     173:</span> <span class="k">*/</span>
<a name="174" /><span class="True">     174:</span> 
<a name="175" /><span class="True">     175:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">PyThreadState</span> <span class="f">*</span><span class="f">)</span> <span class="b">PyEval_SaveThread</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="176" /><span class="True">     176:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">PyEval_RestoreThread</span><span class="f">(</span><span class="b">PyThreadState</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="177" /><span class="True">     177:</span> 
<a name="178" /><span class="True">     178:</span> <span class="f">#</span><span class="n">ifdef</span> <a href="macros_ref.html#_V0lUSF9USFJFQURfMA__"><span class="b">WITH_THREAD</span></a>
<a name="179" /><span class="True">     179:</span> 
<a name="180" /><span class="True">     180:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span>  <span class="b">PyEval_ThreadsInitialized</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="181" /><span class="True">     181:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">PyEval_InitThreads</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="182" /><span class="True">     182:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="183" /><span class="True">     183:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">_PyEval_FiniThreads</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="184" /><span class="True">     184:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* !Py_LIMITED_API */</span>
<a name="185" /><span class="True">     185:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">PyEval_AcquireLock</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="186" /><span class="True">     186:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">PyEval_ReleaseLock</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="187" /><span class="True">     187:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">PyEval_AcquireThread</span><span class="f">(</span><span class="b">PyThreadState</span> <span class="f">*</span><span class="b">tstate</span><span class="f">)</span><span class="f">;</span>
<a name="188" /><span class="True">     188:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">PyEval_ReleaseThread</span><span class="f">(</span><span class="b">PyThreadState</span> <span class="f">*</span><span class="b">tstate</span><span class="f">)</span><span class="f">;</span>
<a name="189" /><span class="True">     189:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">PyEval_ReInitThreads</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="190" /><span class="True">     190:</span> 
<a name="191" /><span class="True">     191:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="192" /><span class="True">     192:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">_PyEval_SetSwitchInterval</span><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span> <span class="b">microseconds</span><span class="f">)</span><span class="f">;</span>
<a name="193" /><span class="True">     193:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">unsigned</span> <span class="m">long</span><span class="f">)</span> <span class="b">_PyEval_GetSwitchInterval</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="194" /><span class="True">     194:</span> <span class="f">#</span><span class="n">endif</span>
<a name="195" /><span class="True">     195:</span> 
<a name="196" /><span class="True">     196:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="197" /><span class="True">     197:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="b">Py_ssize_t</span><span class="f">)</span> <span class="b">_PyEval_RequestCodeExtraIndex</span><span class="f">(</span><span class="b">freefunc</span><span class="f">)</span><span class="f">;</span>
<a name="198" /><span class="True">     198:</span> <span class="f">#</span><span class="n">endif</span>
<a name="199" /><span class="True">     199:</span> 
<a name="200" /><span class="True">     200:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfQkVHSU5fQUxMT1dfVEhSRUFEU18w"><span class="b">Py_BEGIN_ALLOW_THREADS</span></a> <span class="f">{</span> \
<a name="201" /><span class="True">     201:</span>                         <span class="b">PyThreadState</span> <span class="f">*</span><span class="b">_save</span><span class="f">;</span> \
<a name="202" /><span class="True">     202:</span>                         <span class="b">_save</span> <span class="f">=</span> <span class="b">PyEval_SaveThread</span><span class="f">(</span><span class="f">)</span><span class="f">;</span>
<a name="203" /><span class="True">     203:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfQkxPQ0tfVEhSRUFEU18w"><span class="b">Py_BLOCK_THREADS</span></a>        <span class="b">PyEval_RestoreThread</span><span class="f">(</span><span class="b">_save</span><span class="f">)</span><span class="f">;</span>
<a name="204" /><span class="True">     204:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfVU5CTE9DS19USFJFQURTXzA_"><span class="b">Py_UNBLOCK_THREADS</span></a>      <span class="b">_save</span> <span class="f">=</span> <span class="b">PyEval_SaveThread</span><span class="f">(</span><span class="f">)</span><span class="f">;</span>
<a name="205" /><span class="True">     205:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfRU5EX0FMTE9XX1RIUkVBRFNfMA__"><span class="b">Py_END_ALLOW_THREADS</span></a>    <span class="b">PyEval_RestoreThread</span><span class="f">(</span><span class="b">_save</span><span class="f">)</span><span class="f">;</span> \
<a name="206" /><span class="True">     206:</span>                  <span class="f">}</span>
<a name="207" /><span class="True">     207:</span> 
<a name="208" /><span class="False">     208:</span> <span class="f">#</span><span class="n">else</span> <span class="k">/* !WITH_THREAD */</span>
<a name="209" /><span class="False">     209:</span> 
<a name="210" /><span class="False">     210:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfQkVHSU5fQUxMT1dfVEhSRUFEU18w"><span class="b">Py_BEGIN_ALLOW_THREADS</span></a> <span class="f">{</span>
<a name="211" /><span class="False">     211:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfQkxPQ0tfVEhSRUFEU18w"><span class="b">Py_BLOCK_THREADS</span></a>
<a name="212" /><span class="False">     212:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfVU5CTE9DS19USFJFQURTXzA_"><span class="b">Py_UNBLOCK_THREADS</span></a>
<a name="213" /><span class="False">     213:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_UHlfRU5EX0FMTE9XX1RIUkVBRFNfMA__"><span class="b">Py_END_ALLOW_THREADS</span></a> <span class="f">}</span>
<a name="214" /><span class="False">     214:</span> 
<a name="215" /><span class="True">     215:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* !WITH_THREAD */</span>
<a name="216" /><span class="True">     216:</span> 
<a name="217" /><span class="True">     217:</span> <span class="f">#</span><span class="n">ifndef</span> <span class="b">Py_LIMITED_API</span>
<a name="218" /><span class="True">     218:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">_PyEval_SliceIndex</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="219" /><span class="True">     219:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">int</span><span class="f">)</span> <span class="b">_PyEval_SliceIndexNotNone</span><span class="f">(</span><span class="b">PyObject</span> <span class="f">*</span><span class="f">,</span> <span class="b">Py_ssize_t</span> <span class="f">*</span><span class="f">)</span><span class="f">;</span>
<a name="220" /><span class="True">     220:</span> <a href="macros_ref.html#_UHlBUElfRlVOQ18w"><span class="b">PyAPI_FUNC</span></a><span class="f">(</span><span class="m">void</span><span class="f">)</span> <span class="b">_PyEval_SignalAsyncExc</span><span class="f">(</span><span class="m">void</span><span class="f">)</span><span class="f">;</span>
<a name="221" /><span class="True">     221:</span> <span class="f">#</span><span class="n">endif</span>
<a name="222" /><span class="True">     222:</span> 
<a name="223" /><span class="True">     223:</span> <span class="k">/* Masks and values used by FORMAT_VALUE opcode. */</span>
<a name="224" /><span class="True">     224:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_RlZDX01BU0tfMA__"><span class="b">FVC_MASK</span></a>      <span class="c">0x3</span>
<a name="225" /><span class="True">     225:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_RlZDX05PTkVfMA__"><span class="b">FVC_NONE</span></a>      <span class="c">0x0</span>
<a name="226" /><span class="True">     226:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_RlZDX1NUUl8w"><span class="b">FVC_STR</span></a>       <span class="c">0x1</span>
<a name="227" /><span class="True">     227:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_RlZDX1JFUFJfMA__"><span class="b">FVC_REPR</span></a>      <span class="c">0x2</span>
<a name="228" /><span class="True">     228:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_RlZDX0FTQ0lJXzA_"><span class="b">FVC_ASCII</span></a>     <span class="c">0x3</span>
<a name="229" /><span class="True">     229:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_RlZTX01BU0tfMA__"><span class="b">FVS_MASK</span></a>      <span class="c">0x4</span>
<a name="230" /><span class="True">     230:</span> <span class="f">#</span><span class="n">define</span> <a href="macros_noref.html#_RlZTX0hBVkVfU1BFQ18w"><span class="b">FVS_HAVE_SPEC</span></a> <span class="c">0x4</span>
<a name="231" /><span class="True">     231:</span> 
<a name="232" /><span class="False">     232:</span> <span class="f">#</span><span class="n">ifdef</span> <span class="b">__cplusplus</span>
<a name="233" /><span class="False">     233:</span> <span class="f">}</span>
<a name="234" /><span class="True">     234:</span> <span class="f">#</span><span class="n">endif</span>
<a name="235" /><span class="True">     235:</span> <span class="f">#</span><span class="n">endif</span> <span class="k">/* !Py_CEVAL_H */</span>
<a name="236" /><span class="True">     236:</span> </pre>
  </body>
</html>
